<!DOCTYPE html>
<html lang="en">
<head>
    <title>客户详细信息</title>
    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="Cache-Control" content="no-store, must-revalidate">
    <meta http-equiv="expires" content="Wed, 26 Feb 1997 08:21:57 GMT">
    <meta http-equiv="expires" content="-1">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="refresh" content="1200">
    <link rel="shortcut icon" href="/dist/img/icon.png" type="image/x-icon">
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" href="/dist/plugins/bootstrap/css/bootstrap.min.css">
    <!--字体-->
    <link rel="stylesheet" href="/dist/css/font-awesome.min.css">
    <!--图标-->
    <link rel="stylesheet" href="/dist/css/ionicons.min.css">
    <!--OA主样式-->
    <link rel="stylesheet" href="/dist/css/OA.min.css?t=86e2297f">
    <link rel="stylesheet" href="/dist/css/skins/OA-skins.min.css?t=222aea35">
    <style>
        .lineOne {
            text-align: left;
        }

        .lineOne span {
            max-height: 20px;
            line-height: 20px;
            overflow: hidden;
            text-overflow: ellipsis;
            display: -webkit-box;
            -webkit-box-orient: vertical;
            -webkit-line-clamp: 1;
            text-align: left;
        }

        .div-td-content-more {
            position: absolute;
            height: auto;
            z-index: 999;
            line-height: 20px;
            background-color: #d3e8fd;
            padding: 8px 6px;
            border: 1px solid #e8e8ea;
            display: none;
        }

        .div-td-content-more i {
            width: 15px;
            height: 12px;
            background: url("/dist/img/more-icon.png");
            position: absolute;
            left: 50px;
            top: -12px;
        }

        .tdColor {
            width:200px;
            background-color: #f8f8f8;
        }
        .td-value {
            text-align: left !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }

        .td-value span {
            display: inline-block;
            max-height: 56px;
            overflow: hidden;
            padding: 0 6px;
            word-wrap: break-word;
            text-align: center !important;
        }
        .td-value1 {
            text-align: center !important;
            vertical-align: middle;
            word-wrap: break-word;
            color: #2a8cec !important;
        }
    </style>
</head>
<body>
<section class="content" id="app">
    <div class="div-td-content-more"><i></i></div>
    <div class="box-body no-padding iframeH2" style="overflow: auto;" id="scrollDiv">
        <table class="table text-center table-width">
            <tbody>
            <template>
                <tr>
                    <td colspan="6" class="tdColor">客户信息</td>
                </tr>
                <tr>
                    <td class="tdColor">客户姓名</td>
                    <td colspan="2" class="td-value1"><span>{{customer.name}}</span></td>
                    <td class="tdColor">客户电话</td>
                    <td colspan="2" class="td-value1"><span>{{customer.tel}}</span></td>
                </tr>
                <tr>
                    <td class="tdColor">客户类型</td>
                    <td colspan="2" class="td-value1"><span>{{customer.customerType?customer.customerType:"-"}}</span></td>
                    <td class="tdColor">客户信用</td>
                    <td colspan="2" class="td-value1"><span>{{customer.customerCredit?customer.customerCredit:"-"}}</span></td>
                </tr>
                <tr>
                    <td class="tdColor">客户生日</td>
                    <td colspan="2" class="td-value1"><span>{{customer.birthday}}</span></td>
                    <td class="tdColor">客户微信</td>
                    <td colspan="2" class="td-value1"><span>{{customer.wechat}}</span></td>
                </tr>
                <tr>
                    <td class="tdColor">客户身份证</td>
                    <td colspan="2" class="td-value1"><span>{{IdNumber(customer.idCard)}}</span></td>
                    <td class="tdColor">客户所在地</td>
                    <td colspan="2" class="td-value1"><span>{{customer.provinceName}}</span></td>
                </tr>
                <tr>
                    <td class="tdColor">客户来源</td>
                    <td colspan="2" class="td-value1"><span>{{customer.source}}</span></td>
                    <td class="tdColor">意向机型</td>
                    <td colspan="2" class="td-value1"><span>{{customer.intentionModel}}</span></td>
                </tr>
                <tr>
                    <td class="tdColor">购买方式</td>
                    <td colspan="2" class="td-value1"><span>{{customer.buyType}}</span></td>
                    <td class="tdColor">购买时间</td>
                    <td colspan="2" class="td-value1"><span>{{customer.buyDate}}</span></td>
                </tr>
                <!--<tr>
                    <td  class="tdColor">基本情况</td>
                    <td  colspan="5" class="td-value"><span>{{customer.OtherCondition}}</span></td>
                </tr>-->
            </template>
            <!--跟踪记录-->
            <tr>
                <td colspan="6" class="tdColor">跟踪记录</td>
            </tr>
            <template v-if="customerVisit.length>0">
                <template  v-for="(item,i) in customerVisit">
                    <tr>
                        <td class="tdColor">拜访时间</td>
                        <td class="td-value1"><span>{{item.createTime}}</span></td>
                        <td class="tdColor">拜访方式</td>
                        <td class="td-value1">
                            <span v-if="item.visitModel==1">面访</span>
                            <span v-else-if="item.visitModel==0">电访</span>
                            <span v-else></span>
                        </td>
                        <td class="tdColor">拜访人员</td>
                        <td class="td-value1"><span>{{item.createName}}</span></td>
                    </tr>
                    <tr>
                        <td class="tdColor">拜访内容</td>
                        <td colspan="5" class="td-value"  @click="lookInterview(item.customerVisitId)"><span>{{item.otherCondition}}</span></td>
                    </tr>
                </template>
            </template>
            <template v-else>
                <tr>
                    <td colspan="6">暂无跟踪数据~</td>
                </tr>
            </template>
            </tbody>
        </table>
    </div>
    <!-- /.box-body -->
</section>
<!--JQ-->
<script src="https://file.ggxqce.com/web/jquery-2.2.3.min.js"></script>
<!--插件JS-->
<script src="https://file.ggxqce.com/web/bootstrap.min.js"></script>
<!--框架已定义 JS-->
<script src="/dist/js/app_iframe.js?t=8e743a31"></script>
<!--oa自定义  JS-->
<script src="/dist/js/oa.js?t=54c6b89c"></script>
<script type="text/javascript" src="/dist/plugins/lhgdialog/lhgdialog.min.js?self=true"></script>
<script src="https://file.ggxqce.com/web/vue.min.js"></script>
<script type="text/javascript" src="/dist/plugins/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">

    var app = new Vue({
        el: '#app',
        data: {
            customer: {
                id: $.wyui.page.urlParams.customerId,
                name: '',
                tel: '',
                wechat: '',
                birthday: '',
                idCard: '',
                provinceName: '',
                cityName: '',
                countyName: '',
                source: '',
                intentionModel: '',
                buyType: '',
                fundCondition: '',
                existingDevice: '',
                OtherCondition: '',
                grade: ''
            },
            customerVisit: []
        },
        methods: {
            IdNumber:function(idNum){
                if (idNum){
                    var firstIdNum=idNum.substring(0,10);
                    var  lastIdNum=idNum.substring(idNum.length-4,idNum.length);
                    return firstIdNum+"****"+lastIdNum;
                }
            },
            lookInterview: function (customerVisitId) {
                var that = this;
                url = "/page/customer/customerVisitDetails.html";
                $.dialog({
                    content: 'url:' + url + '?id=' + customerVisitId ,
                    title: '拜访详情',
                    width: 300,
                    height: 500,
                    max: false,
                    min: false,
                    lock: true
                });
            }
        },
        mounted: function () {
            var that = this;
            var data = {'customerId': $.wyui.page.urlParams.customerId}
            $.wyui.postMethod('/customerReport/getCustomerById.json', data, function (r) {
                console.log(r);
                that.customer = r.customerInfo;
                that.customerVisit = r.customerVisitInfo;
            });

        }
    });

</script>

</body>
</html>